#include "party-protocol/channel.hpp"
#include "party-protocol/packet.hpp"
#include "party-protocol/receiver.hpp"
#include <sys/socket.h>
#include <cstdio>

int main(){
    int a=socket(AF_INET,SOCK_DGRAM,0);
    std::function<bool (Packet*)> onreceive=[](Packet *p){
        printf((char*)p->content.addr);
        printf("\n");
        return true;
    };
    Channel c=Channel(1, channel_reliable, 10, a, &onreceive);
    Receiver r=Receiver();
    r.addChannel(&c);
    r.receive_blocking();
    return 0;
}
